package com.wondersgroup.insurance.claimlib.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;


public class NetManagerUtil {




    public static boolean isConnectNet(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo Mobile = connectivityManager
                .getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

        NetworkInfo Wifi = connectivityManager
                .getNetworkInfo(ConnectivityManager.TYPE_WIFI);
        if (Mobile !=null&& Mobile.getState() !=null && Mobile.getState().equals(NetworkInfo.State.DISCONNECTED)
            && Wifi !=null&& Wifi.getState() !=null &&Wifi.getState().equals(NetworkInfo.State.DISCONNECTED)) {
            return false;
        }
        return true;
    }



}
